package com.lin.linchatgpt.openai.server.imple;

import com.lin.linchatgpt.entity.Message;
import com.lin.linchatgpt.entity.dto.MessageDTO;
import com.lin.linchatgpt.openai.server.HistoryHandlerMessageStrategy;

import java.util.List;

/**
 * Copyright(C),2022年-2022,霖霖
 *
 * @author 霖霖
 * @version 1.0
 * @date 2023/6/22 21:15
 * @Description 不同类型消息处理策略
 */
public class MessageHandleStrategy {
    private HistoryHandlerMessageStrategy historyHandlerMessage;

    public void setHandleStrategy(HistoryHandlerMessageStrategy historyHandlerMessage){
        this.historyHandlerMessage = historyHandlerMessage;
    }
    // 执行策略
    public List<Message> sendMessage(MessageDTO messageDTO){
        return historyHandlerMessage.historyMessageHandler(messageDTO);
    }
}
